#include <opencv4/opencv2/opencv.hpp>
#include <iostream>
#include <fstream>
#include"Buff.h"
#include"ArmorDector.h"
#include"offsetSolve.h"
using namespace std;
using namespace cv;

//射击抽象类
class Operation
{
public:
    Operation(){}
    virtual ~Operation() {};
    void setImg(Mat src);
    virtual Point2f shootCenter()  = 0;
protected:
    Mat _src;
    Point2f _center;
};

//装甲版模式
class ArmorOperation : public Operation
{
public:
    ArmorOperation();
    virtual ~ArmorOperation() override ;
    bool armCenter();
    int armorType();
    virtual Point2f shootCenter() override;
private:
    shared_ptr<ArmorDetector> _arm;
};

//神符模式
class BuffOperation : public Operation
{
public:
    BuffOperation();
    virtual ~BuffOperation() override ;
    bool buffCenter();
    virtual Point2f shootCenter() override;

private:
    shared_ptr<BuffDetector> _buff;
};

//不需要射击
class NoTaskOperation : public Operation
{
public:
    NoTaskOperation(){}
    virtual ~NoTaskOperation() override {}
    virtual Point2f shootCenter() override;
private:
};


//任务工厂(工厂方法模式)
class TaskFactory
{
public:
    TaskFactory(){}
    virtual ~TaskFactory() {};
    virtual shared_ptr<Operation> creatTask() = 0;
private:
};
//装甲板射击工厂
class ArmorShootFactory : public TaskFactory
{
public:
    ArmorShootFactory(){}
    virtual ~ArmorShootFactory() override {}
    virtual shared_ptr<Operation> creatTask() override;
private:
};
//神符射击工厂
class BuffShootFactory : public TaskFactory
{
public:
    BuffShootFactory(){}
    virtual ~BuffShootFactory() override {}
    virtual shared_ptr<Operation> creatTask() override;
private:
};
//无任务工厂
class NoTaskFactory : public TaskFactory
{
public:
    NoTaskFactory(){}
    virtual ~NoTaskFactory() override {}
    virtual shared_ptr<Operation>creatTask() override;
private:
};